<?php
class CategoriaParticipante extends Zend_Db_Table {
	protected $_name 	= 'categoria_participante';
    protected $_primary = 'id_categoria';

    public function __construct(){
    	parent::__construct();
    	$this->id_categoria=null;
    	$this->ds_categoria=null;
    	$this->id_usuario=null;
    	$this->dt_alteracao=null;
    }

    public function load($id){
    	$row = $this->find($id)->current();
    	$this->id_categoria	=$row['id_categoria'];
    	$this->ds_categoria	=$row['ds_categoria'];
    	$this->id_usuario	=$row['id_usuario'];
    	$this->dt_alteracao	=$row['dt_alteracao'];
    }

    public function buscar(){
    	$db = Zend_Registry::get('db');
    	$sql="select id_categoria,
    				 ds_categoria
    	      	from categoria_participante";
    	return $db->query($sql)->fetchAll();
    }

}